package com.crazy.writer.handlers;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;

import com.crazy.writer.handlers.console.view.WorkSpaceView;


/**
 * Our sample handler extends AbstractHandler, an IHandler base class.
 * @see org.eclipse.core.commands.IHandler
 * @see org.eclipse.core.commands.AbstractHandler
 */
public class SampleHandler extends AbstractHandler {

	@Override
	public Object execute(ExecutionEvent event) throws ExecutionException {
	    try {
		PlatformUI.getWorkbench().getActiveWorkbenchWindow()
		.getActivePage().showView(WorkSpaceView.ID);
	    } catch (PartInitException e) {
		e.printStackTrace();
	    }
	    return null;
	}
}
